package deng.jboss.examples.webservices;

import java.text.SimpleDateFormat;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

/**
 * Hello program.
 * 
 * @author Zemian Deng
 */

@WebService
@SOAPBinding(style=SOAPBinding.Style.RPC)
public class HelloSubject {

	@WebMethod
	public String getGreeting(@WebParam(name="subject") Subject subject) {
		return "Hello " + subject.getName();
	}
	
	@WebMethod
	public Subject getSubject(@WebParam(name="subjectName") String subjectName) throws Exception {
		SimpleDateFormat df = new SimpleDateFormat("MMddyyyy");
		Subject s = new Subject();
		s.setName(subjectName);
		s.setDateOfBirth(df.parse("01012010"));
		return s;
	}
	
}